﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Mall.MCScriptManageServices
{
    public partial class UpdateOrderInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            // ["ID", "OrderNum", "UserId", "OrderTime", "State", "Price", "Point", "Paytype", "RecName", "RecAddress",
            //"RecZip", "RecTel", "RecMobile", "RecArieid", "Intro", "EmsType", "EmsState", "EmsNo", "EmsIntro" ];
            string _ID = Request["ID"] == null ? "0" : Request["ID"].ToString();
            string _OrderNum = Request["OrderNum"] == null ? "" : Request["OrderNum"].ToString();
            string _UserId = Request["UserId"] == null ? "0" : Request["UserId"].ToString();
            string _OrderTime = Request["OrderTime"] == null ? DateTime.Now.ToString() : Request["OrderTime"].ToString();
            string _State = Request["State"] == null ? "0" : Request["State"].ToString();
            string _Price = Request["Price"] == null ? "0" : Request["Price"].ToString();
            string _Point = Request["Point"] == null ? "0" : Request["Point"].ToString();
            string _Paytype = Request["Paytype"] == null ? "" : Request["Paytype"].ToString();
            string _RecName = Request["RecName"] == null ? "" : Request["RecName"].ToString();
            string _RecAddress = Request["RecAddress"] == null ? "" : Request["RecAddress"].ToString();
            string _RecZip = Request["RecZip"] == null ? "" : Request["RecZip"].ToString();
            string _RecTel = Request["RecTel"] == null ? "" : Request["RecTel"].ToString();
            string _RecMobile = Request["RecMobile"] == null ? "" : Request["RecMobile"].ToString();
            string _RecArieid = Request["RecArieid"] == null ? "0" : Request["RecArieid"].ToString();
            string _Intro = Request["Intro"] == null ? "" : Request["Intro"].ToString();
            string _EmsType = Request["EmsType"] == null ? "" : Request["EmsType"].ToString();
            string _EmsState = Request["EmsState"] == null ? "" : Request["EmsState"].ToString();
            string _EmsNo = Request["EmsNo"] == null ? "" : Request["EmsNo"].ToString();
            string _EmsIntro = Request["EmsIntro"] == null ? "" : Request["EmsIntro"].ToString();
            MODEL.MOrder model = new MODEL.MOrder();
            model.Id = Convert.ToInt32(_ID);
            model.OrderNum = _OrderNum;
            model.Userid = Convert.ToInt32(_UserId);
            model.OrderTime = Convert.ToDateTime(_OrderTime);
            model.State = Convert.ToInt32(_State);
            model.Price = Convert.ToDecimal(_Price);
            model.Point = Convert.ToInt32(_Point);
            model.Paytype = Convert.ToInt32(_Paytype);
            model.RecName = _RecName;
            model.RecAddress = _RecAddress;
            model.RecZip = _RecZip;
            model.RecTel = _RecTel;
            model.RecMobile = _RecMobile;
            model.RecArieid = Convert.ToInt32(_RecArieid);
            model.Intro = _Intro;
            model.EmsType = Convert.ToInt32(_EmsType);
            model.EmsState = Convert.ToInt32(_EmsState);
            model.EmsNo = _EmsNo;
            model.EmsIntro = _EmsIntro;
            BLL.Models.MOrderModels modelso = new BLL.Models.MOrderModels();

            bool ret = modelso.UpdateOrder(model);
            string jsons = string.Empty;
            if (ret)
            {

                jsons = "{success:'true'}";

            }
            else
            {

                jsons = "{success:'false'}";
            }
            Response.Write(jsons);
        }
    }
}